package com.achang.achangmall.product.conf;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.redisson.config.TransportMode;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/******
 @author 阿昌
 @create 2021-10-06 13:54
 *******
 */
@Configuration
public class RedissonConfig {

    @Bean(destroyMethod = "shutdown")
    public RedissonClient redissonClient(){
        Config config = new Config();
//        config.setTransportMode(TransportMode.EPOLL);
//        config.useClusterServers()
//                //可以用"rediss://"来启用SSL连接
//                .addNodeAddress("");
        config.useSingleServer().setAddress("redis://192.168.109.101:6379");
        return Redisson.create(config);
    }

}
